list = list(range(0,10))
# 起始index:结束index:步长 注意前包后不包
print(list)
# [0, 1, 2]
print(list[0:3])
# [0, 2, 4]
print(list[0:6:2])
# [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
print(list[::])
# [0, 1, 2]
print(list[:3])
# [0, 1, 2]
print(list[:3:])
# [1, 3, 5, 7, 9]
print(list[1::2])
# [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
print(list[::-1])
# [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
print(list[:100:])
# []
print(list[100:])
print('++++++++++++++++++++++++++++++')
print(list)
#切片修改
list[5:6:] = '李昊哲'
print(list)
list[4:5:] = ['李昊哲']
print(list)
#在尾部追加元素
list[len(list):] = ['李昊哲']
print(list)
# 替换前3个元素
list[:3] = ['李昊哲','徐晓羽','小可爱']
# 切片删除
list[:3] = []
print(list)
# 删除偶数位置上的元素
del list[::2]
print(list)


